<?php

# Get configuration
define('OI', true);
include(dirname(dirname(dirname(__FILE__))).'/sources/Config.php');

if(!function_exists('compressBuffer')) {
		
	function compressBuffer($buffer) {
		global $config;
		$buffer = str_replace('[images]', $config['root_url'].'images/template/', $buffer);
		$buffer = str_replace(array("\n", "\r", "\t", "} ", " {"), array('', '', '', '}', '{'), $buffer);
		$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
		$buffer = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $buffer);
		return $buffer;
	}
			
}

# Minimum cache length
$expiresTime = 60*60*24*7;

# CSS Headers
header("Content-type: text/css; charset=UTF-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s", filemtime('coreStyles.css'))." GMT");
header("Cache-Control: must-revalidate");
header("Pragma: public");
header("Vary: Accept-Encoding");
header('Expires: '.gmdate('D, d M Y H:i:s', time()+$expiresTime).' GMT');

# Output mini-buffer
ob_start('compressBuffer');
	include_once(dirname(__FILE__).'/coreStyles.css');		
ob_end_flush();
		
# Flush page
flush();
exit;

?>